/*
 Navicat Premium Data Transfer

 Source Server         : 阿里云
 Source Server Type    : MySQL
 Source Server Version : 50744 (5.7.44)
 Source Host           : dev.cen-xi.xyz:3306
 Source Schema         : role

 Target Server Type    : MySQL
 Target Server Version : 50744 (5.7.44)
 File Encoding         : 65001

 Date: 27/12/2023 13:47:10
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for cx_account
-- ----------------------------
DROP TABLE IF EXISTS `cx_account`;
CREATE TABLE `cx_account` (
  `id` bigint(20) NOT NULL COMMENT '主键',
  `deleted` tinyint(4) NOT NULL DEFAULT '1' COMMENT '逻辑删除0-禁用 1-启用',
  `account` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL COMMENT '账号',
  `nick_name` varchar(32) DEFAULT NULL COMMENT '用户名称',
  `password` varchar(64) DEFAULT NULL COMMENT '密码',
  `state` tinyint(4) NOT NULL DEFAULT '1' COMMENT '0-禁用 1-启用',
  `remark` varchar(255) DEFAULT NULL COMMENT '备注',
  `login_date` date DEFAULT NULL COMMENT '最后登录时间',
  `create_time` date DEFAULT NULL COMMENT '创建时间',
  `update_time` date DEFAULT NULL COMMENT '修改时间',
  `avatar` varchar(255) DEFAULT NULL COMMENT '头像',
  `create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
  `update_by` varchar(255) DEFAULT NULL COMMENT '修改人',
  `login_time` datetime DEFAULT NULL COMMENT '登录时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='账户表';

-- ----------------------------
-- Records of cx_account
-- ----------------------------
BEGIN;
INSERT INTO `cx_account` (`id`, `deleted`, `account`, `nick_name`, `password`, `state`, `remark`, `login_date`, `create_time`, `update_time`, `avatar`, `create_by`, `update_by`, `login_time`) VALUES (1, 1, 'admin', '测试账号', '49ba59abbe56e057', 1, '测试账号备注', '2023-09-11', '2023-04-25', '2023-12-27', 'https://www.cen-xi.xyz/dev/349fcce7-a6cb-4fd2-811d-37a64627e89c_u%3D2490939159%2C251868101%26fm%3D253%26fmt%3Dauto%26app%3D120%26f%3DJPEG%20%281%29.jpg', NULL, NULL, '2023-12-27 11:59:04');
INSERT INTO `cx_account` (`id`, `deleted`, `account`, `nick_name`, `password`, `state`, `remark`, `login_date`, `create_time`, `update_time`, `avatar`, `create_by`, `update_by`, `login_time`) VALUES (1693533112841179138, 0, 'c_001', 'test账户', '5be9eae0be3de71e', 1, 'test账户', NULL, '2023-08-21', '2023-08-21', 'www.baidu.com', NULL, NULL, NULL);
INSERT INTO `cx_account` (`id`, `deleted`, `account`, `nick_name`, `password`, `state`, `remark`, `login_date`, `create_time`, `update_time`, `avatar`, `create_by`, `update_by`, `login_time`) VALUES (1693533932202659842, 1, 'c_001', 'test账户', '5be9eae0be3de71e', 1, 'test账户', NULL, '2023-08-21', '2023-08-21', 'www.baidu.com', NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for cx_account_role_re
-- ----------------------------
DROP TABLE IF EXISTS `cx_account_role_re`;
CREATE TABLE `cx_account_role_re` (
  `role_id` bigint(20) NOT NULL COMMENT '角色id',
  `account_id` bigint(20) NOT NULL COMMENT '账户id',
  `id` bigint(20) NOT NULL COMMENT '主键',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='账户角色表';

-- ----------------------------
-- Records of cx_account_role_re
-- ----------------------------
BEGIN;
INSERT INTO `cx_account_role_re` (`role_id`, `account_id`, `id`) VALUES (1, 1, 1);
COMMIT;

-- ----------------------------
-- Table structure for cx_menu
-- ----------------------------
DROP TABLE IF EXISTS `cx_menu`;
CREATE TABLE `cx_menu` (
  `id` bigint(20) NOT NULL COMMENT '主键id',
  `state` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态1:启用, 0未启用',
  `remark` varchar(255) DEFAULT NULL COMMENT '菜单备注',
  `create_time` date DEFAULT NULL COMMENT '创建时间',
  `update_time` date DEFAULT NULL COMMENT '修改时间',
  `deleted` tinyint(4) NOT NULL DEFAULT '1' COMMENT '逻辑删除1:未删除, 0:删除',
  `parent_id` bigint(20) NOT NULL COMMENT '父级id',
  `menu_name` varchar(64) DEFAULT NULL COMMENT '菜单名称',
  `sort` int(11) DEFAULT NULL COMMENT '排序',
  `path` varchar(64) DEFAULT NULL COMMENT '路由地址',
  `component` varchar(64) DEFAULT NULL COMMENT '组件路径',
  `query` varchar(64) DEFAULT NULL COMMENT '路由参数',
  `frame` tinyint(4) DEFAULT '1' COMMENT '是否为外链（0是 1否）',
  `cache` tinyint(4) DEFAULT '1' COMMENT '是否缓存（0缓存 1不缓存）',
  `menu_type` char(1) DEFAULT '' COMMENT '菜单类型（M目录 C菜单 F按钮）',
  `perms` varchar(64) DEFAULT NULL COMMENT '权限标识',
  `icon` varchar(64) DEFAULT '#' COMMENT '菜单图标',
  `visible` tinyint(4) NOT NULL DEFAULT '0' COMMENT '菜单显示状态（0显示 1隐藏）',
  `create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
  `update_by` varchar(255) DEFAULT NULL COMMENT '修改人',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='菜单表';

-- ----------------------------
-- Records of cx_menu
-- ----------------------------
BEGIN;
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (1, 1, '商户管理', '2023-04-25', '2023-04-25', 1, 0, '商户管理', 1, 'comercial', NULL, NULL, 1, 1, 'M', NULL, 'book', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (2, 1, '用户管理', '2023-04-25', '2023-04-25', 1, 0, '用户管理', 2, 'user', NULL, NULL, 1, 1, 'M', NULL, 'book', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (3, 1, '交易信息管理', '2023-04-25', '2023-04-25', 1, 0, '交易信息管理', 3, 'transaction', NULL, NULL, 1, 1, 'M', NULL, 'book', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (4, 1, '客户管理', '2023-04-25', '2023-04-25', 1, 0, '客户管理', 4, 'service', NULL, NULL, 1, 1, 'M', NULL, 'book', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (5, 1, '账号管理', '2023-04-25', '2023-04-25', 1, 0, '账号管理', 5, 'account-manager', NULL, NULL, 1, 1, 'M', NULL, 'book', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (6, 1, '系统管理', '2023-04-25', '2023-04-25', 1, 0, '系统管理', 6, 'system', NULL, NULL, 1, 1, 'M', NULL, 'book', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (100, 1, '商户列表', '2023-04-25', '2023-04-25', 1, 1, '商户列表', 1, 'merchantlist', 'comercial/merchantlist/index', NULL, 1, 1, 'C', 'comercial:merchantlist:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (101, 1, '平台公告', '2023-04-25', '2023-04-25', 1, 1, '平台公告', 2, 'notify', 'comercial/notify/index', NULL, 1, 1, 'C', 'comercial:notify:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (102, 1, '商户额度记录', '2023-04-25', '2023-04-25', 1, 1, '商户额度记录', 3, 'quota-record', 'comercial/quota-record/index', NULL, 1, 1, 'C', 'comercial:quota-record:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (103, 1, '转出转入数据统计', '2023-04-25', '2023-04-25', 1, 1, '转出转入数据统计', 4, 'transfer-data-statistics', 'comercial/transfer-data-statistics/index', NULL, 1, 1, 'C', 'comercial:transfer-data-statistics:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (200, 1, '用户列表', '2023-04-25', '2023-04-25', 1, 2, '用户列表', 1, 'userlist', 'user/userlist/index', NULL, 1, 1, 'C', 'user:userlist:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (201, 1, '转出转入明细', '2023-04-25', '2023-04-25', 1, 2, '转出转入明细', 2, 'transfer-detail', 'user/transfer-detail/index', NULL, 1, 1, 'C', 'user:transfer-detail:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (202, 1, '用户交易明细', '2023-04-25', '2023-04-25', 1, 2, '用户交易明细', 3, 'deal-detail', 'user/deal-detail/index', NULL, 1, 1, 'C', 'user:deal-detail:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (203, 1, '信用分变动记录', '2023-04-25', '2023-04-25', 1, 2, '信用分变动记录', 4, 'creditpoints', 'user/creditpoints/index', NULL, 1, 1, 'C', 'user:creditpoints:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (204, 1, '黑名单', '2023-04-25', '2023-04-25', 1, 2, '黑名单', 5, 'blacklist', 'user/blacklist/index', NULL, 1, 1, 'C', 'user:blacklist:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (300, 1, '交易概况', '2023-04-25', '2023-04-25', 1, 3, '交易概况', 1, 'situation', 'transaction/situation/index', NULL, 1, 1, 'C', 'transaction:situation:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (301, 1, '挂单列表', '2023-04-25', '2023-04-25', 1, 3, '挂单列表', 2, 'hang-order', 'transaction/hang-order/index', NULL, 1, 1, 'C', 'transaction:hang-order:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (302, 1, '交易订单明细', '2023-04-25', '2023-04-25', 1, 3, '交易订单明细', 3, 'orderlist', 'transaction/orderList/index', NULL, 1, 1, 'C', 'transaction:orderList:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (303, 1, '申诉列表', '2023-04-25', '2023-04-25', 1, 3, '申诉列表', 4, 'appeal', 'transaction/appeal/index', NULL, 1, 1, 'C', 'transaction:appeal:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (400, 1, '在线客服', '2023-04-25', '2023-04-25', 1, 4, '在线客服', 1, 'online', 'service/online/index', NULL, 1, 1, 'C', 'service:online:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (401, 1, '常用语句编辑', '2023-04-25', '2023-04-25', 1, 4, '常用语句编辑', 2, 'statements', 'service/statements/index', NULL, 1, 1, 'C', 'service:statements:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (500, 1, '账号管理', '2023-04-25', '2023-04-25', 1, 5, '账号管理', 1, 'account', 'account-manager/account/index', NULL, 1, 1, 'C', 'account-manager:account:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (501, 1, '角色权限设置', '2023-04-25', '2023-04-25', 1, 5, '角色权限设置', 2, 'role-settings', 'account-manager/role-settings/index', NULL, 1, 1, 'C', 'account-manager:role-settings:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (600, 1, '菜单管理', '2023-04-25', '2023-04-25', 1, 6, '菜单管理', 1, 'menu', 'system/menu/index', NULL, 1, 1, 'C', 'system:menu:list', 'bookmark', 0, NULL, NULL);
INSERT INTO `cx_menu` (`id`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `parent_id`, `menu_name`, `sort`, `path`, `component`, `query`, `frame`, `cache`, `menu_type`, `perms`, `icon`, `visible`, `create_by`, `update_by`) VALUES (601, 1, '参数设置', '2023-04-25', '2023-04-25', 1, 6, '参数设置', 2, 'setting', 'system/setting/index', NULL, 1, 1, 'C', 'system:setting:list', 'bookmark', 0, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for cx_role
-- ----------------------------
DROP TABLE IF EXISTS `cx_role`;
CREATE TABLE `cx_role` (
  `id` bigint(20) NOT NULL COMMENT '角色id',
  `role_name` varchar(255) DEFAULT NULL COMMENT '角色名称',
  `state` tinyint(4) NOT NULL DEFAULT '1' COMMENT '角色状态1:启用, 0未启用',
  `remark` varchar(255) DEFAULT NULL COMMENT '角色备注',
  `create_time` date DEFAULT NULL COMMENT '创建时间',
  `update_time` date DEFAULT NULL COMMENT '修改时间',
  `deleted` tinyint(4) NOT NULL DEFAULT '1' COMMENT '逻辑删除1:未删除, 0:删除',
  `create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
  `update_by` varchar(255) DEFAULT NULL COMMENT '修改人',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色表';

-- ----------------------------
-- Records of cx_role
-- ----------------------------
BEGIN;
INSERT INTO `cx_role` (`id`, `role_name`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `create_by`, `update_by`) VALUES (1, '超级管理员', 1, '超级管理员', '2023-04-25', '2023-04-25', 1, NULL, NULL);
INSERT INTO `cx_role` (`id`, `role_name`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `create_by`, `update_by`) VALUES (2, '普通用户', 1, '普通用户', '2023-04-25', '2023-04-25', 1, NULL, NULL);
INSERT INTO `cx_role` (`id`, `role_name`, `state`, `remark`, `create_time`, `update_time`, `deleted`, `create_by`, `update_by`) VALUES (1693536589864751105, 'test角色', 1, 'test角色', '2023-08-21', '2023-08-21', 1, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for cx_role_menu_re
-- ----------------------------
DROP TABLE IF EXISTS `cx_role_menu_re`;
CREATE TABLE `cx_role_menu_re` (
  `role_id` bigint(20) NOT NULL COMMENT '角色id',
  `menu_id` bigint(20) NOT NULL COMMENT '菜单id',
  `id` bigint(20) NOT NULL COMMENT '主键',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色菜单表';

-- ----------------------------
-- Records of cx_role_menu_re
-- ----------------------------
BEGIN;
INSERT INTO `cx_role_menu_re` (`role_id`, `menu_id`, `id`) VALUES (1, 1, 1);
INSERT INTO `cx_role_menu_re` (`role_id`, `menu_id`, `id`) VALUES (1, 100, 2);
INSERT INTO `cx_role_menu_re` (`role_id`, `menu_id`, `id`) VALUES (1, 101, 3);
INSERT INTO `cx_role_menu_re` (`role_id`, `menu_id`, `id`) VALUES (1, 102, 4);
INSERT INTO `cx_role_menu_re` (`role_id`, `menu_id`, `id`) VALUES (1, 103, 5);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
